<%@page import="lib_model.WareHouse.Warehouse"%>
<%@page import="lib_model.Product.Products"%>
<%@page import="lib_model.Account.Account_factory"%>
<%@page import="lib_model.Account.Account"%>
<%@page import="java.util.ArrayList"%>
<%@page import="lib_model.Factories.Stocks_factory"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<jsp:include page="../templates/Factories.jsp"></jsp:include>
Transporter
<jsp:include page="../templates/Title.jsp"></jsp:include>
<jsp:include page="../templates/StyleFac.jsp"></jsp:include>
<div class="body-center w960">
<h2 class="title-show">Transporter Product to Warehouse</h2>
<form action="../factories/Transporter" method="post">
<table class="tb" style="width: 300px;" id="createfac">
	<thead>
		<tr>
			<th align="left" width="20%"></th>
			<th align="left" width="20%"></th>
		</tr>
		<tr>
			<td>Product</td>
			<td>
			<%
				Account acc = (Account) request.getSession().getAttribute("User");
				String usn = acc.username;
				int fac_id = 0;
				fac_id = ((Account_factory) (new Account_factory(usn)
						.GetInformation().ObjResult)).factory_id_ref;
				Stocks_factory fac = new Stocks_factory();
				ArrayList<Stocks_factory> fp = (ArrayList<Stocks_factory>) fac
						.SelectByIDfactory(fac_id).ObjResult;
			%> <select name="productid">
				<%
					for (Stocks_factory fps : fp) {
						Products p = (Products) (new Products(fps.products_id_ref)
								.GetInformation()).ObjResult;
				%>
				<option value="<%=p.id%>"><%=p.name %></option>
				
				<%
					}
				%>
			</select></td>
			</tr><tr>
			<td>WareHouse</td>
			<td>
			<select name="warehouseid">
				<%
					Warehouse wh = new Warehouse();
					ArrayList<Warehouse> whl = (ArrayList<Warehouse>)wh.Select().ObjResult;	
					for (Warehouse whs : whl) {
				%>
				<option value="<%=whs.id%>"><%=whs.name %></option>
				<%
					}
				%>
			</select></td>
			
		</tr>
		<tr>
			<td>Quantity</td>
			<td><input type="text" name="txtQuan" /></td>
		</tr>
		<tr align="center">
			<td colspan="2"><input type="submit" value="Add"></td>
		</tr>
	</thead>
</table>
</form>
</div>
<jsp:include page="../templates/Footer.jsp"></jsp:include>